<template>
	<view class="dailyStatement">
		<mescroll-uni height="100%" bottom="500rpx" @init="mescrollInit" @down="refresh" @up="load" :up="upOption"
			:down="downOption">
			<view class="item">
				<uni-collapse>
					<uni-collapse-item titleBorder="none" :open="true">
						<template v-slot:title>
							<view class="title-wrapper">
								<view class="title">
									结算日 2024年9月1日
								</view>
								<!-- <uni-icons type="bottom" size="18" color="#898989"></uni-icons> -->
							</view>
							<view class="info">
								<text class="collection">收款：886.32元</text>
								<text class="refund">退款：126.32元</text>
							</view>
						</template>
						<view class="content">
							<view class="child-item collection">
								<view class="child-title-wrapper">
									<view class="label">
										收款：客户订货
									</view>
									<view class="amount">
										+ 1234.01元
									</view>
									<uni-icons type="right" color="#898989" size="16"></uni-icons>
								</view>
								<view class="child-date-wrapper">
									<text class="date">交易日：2024.09.01</text>
									<text class="total-amount">总余额(+)：88823.66元</text>
								</view>
								<view class="child-info-wrapper">
									<text>待结算(+) ：8888.68元</text>
									<text>可提现：8888.68元</text>
								</view>
							</view>

							<view class="child-item refund">
								<view class="child-title-wrapper">
									<view class="label">
										收款：客户订货
									</view>
									<view class="amount">
										+ 1234.01元
									</view>
									<uni-icons type="right" color="#898989" size="16"></uni-icons>
								</view>
								<view class="child-date-wrapper">
									<text class="date">交易日：2024.09.01</text>
									<text class="total-amount">总余额(+)：88823.66元</text>
								</view>
								<view class="child-info-wrapper">
									<text>待结算(+) ：8888.68元</text>
									<text>可提现：8888.68元</text>
								</view>
							</view>
							<view class="child-item">
								<view class="child-title-wrapper">
									<view class="label">
										收款：客户订货
									</view>
									<view class="amount">
										+ 1234.01元
									</view>
									<uni-icons type="right" color="#898989" size="16"></uni-icons>
								</view>
								<view class="child-date-wrapper">
									<text class="date">交易日：2024.09.01</text>
									<text class="total-amount">总余额(+)：88823.66元</text>
								</view>
								<view class="child-info-wrapper">
									<text>待结算(+) ：8888.68元</text>
									<text>可提现：8888.68元</text>
								</view>
							</view>
						</view>
					</uni-collapse-item>
				</uni-collapse>
			</view>
		</mescroll-uni>
	</view>
</template>

<script>
	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
	export default {
		mixins: [MescrollMixin], // 使用mixin
		data() {
			return {
				list: [],
				pageNum: 1,
				pageSize: 10,
				downOption: {
					auto: true // 不自动加载 (mixin已处理第一个tab触发downCallback)
				},
				upOption: {
					auto: false,
					noMoreSize: 2, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
					empty: {
						tip: '暂无相关数据',
						//icon: '../../../../static/image/noorder.png',
						fixed: true,
						top: '200upx',
					},
					textNoMore: '没有更多啦',
				},
			}
		},
		mounted() {

		},
		methods: {
			load(paging) {
				this.pageNum = paging.num;
				this.getList();
			},
			refresh() {
				this.doSearch();
			},
			doSearch() {
				this.mescroll.resetUpScroll()
			},
			async getList(type) {
				// const params = {
				// 	pageNum: this.pageNum,
				// 	pageSize: this.pageSize,
				// 	orgId: this.org.id,
				// 	type: 2
				// }
				// const data = await this.$api.get('/clz-portal/stock-out/page', params, false)
				// console.log(data.data)
				// if (data.code === 200) {
				// 	if (this.pageNum === 1) {
				// 		this.list = [];
				// 	}
				// 	this.list = this.list.concat(data.data.records);
				// 	this.mescroll.endByPage(data.data.records.length, data.data.pages);
				// }

				this.mescroll.endByPage(1, 1);
			},
		},
		components: {

		}
	}
</script>

<style lang="scss" scoped>
	.dailyStatement {
		overflow: hidden;

		.item {
			margin-bottom: 10upx;

			.title-wrapper {
				display: flex;
				align-items: center;
				padding: 20upx;

				.title {
					padding-left: 10upx;
					border-left: 10upx solid #0E932E;
				}
			}

			.info {
				text-align: right;
				font-size: 28upx;
				margin-bottom: 20upx;

				.collection {
					color: red;
				}

				.refund {
					color: #0E932E;
					margin-left: 20upx;
				}
			}

			.content {
				.child-item {
					border-top: 3upx solid #F2F4FA;
					font-size: 32upx;
					padding: 30upx;

					.child-title-wrapper {
						display: flex;
						align-items: center;

						.label {
							flex: 1;
						}
					}

					.child-date-wrapper {
						display: flex;
						align-items: center;
						justify-content: space-between;
						font-size: 26upx;
						margin: 10upx 0 20upx 0;

						.date {
							color: #666666;
						}
					}

					.child-info-wrapper {
						display: flex;
						align-items: center;
						justify-content: space-between;
						font-size: 28upx;
					}



					&.collection {
						color: #FC0303;
					}

					&.refund {
						color: #0E932E;
					}
				}
			}
		}
	}
</style>